package com.jlkf.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jlkf.dao.TblStudentStoryMapper;
import com.jlkf.pojo.TblStudentStory;
import com.jlkf.service.StudentStoryService;
import com.platform.server.response.response.pojo.ReturnData;

@Service
public class StudentStoryServiceImpl implements StudentStoryService {
	@Autowired
	private TblStudentStoryMapper tblStudentStoryMapper;
	
	/**
	 * 学员故事列表
	 */
	@Override
	public List<TblStudentStory> getList(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return tblStudentStoryMapper.selectList(map);
	}

	@Override
	public int insert(TblStudentStory story) {
		// TODO Auto-generated method stub
		return tblStudentStoryMapper.insertSelective(story);
	}

	@Override
	public int update(TblStudentStory story) {
		// TODO Auto-generated method stub
		return tblStudentStoryMapper.updateByPrimaryKeySelective(story);
	}

	@Override
	public int delete(Integer gId) {
		// TODO Auto-generated method stub
		return tblStudentStoryMapper.deleteByPrimaryKey(gId);
	}

	@Override
	public TblStudentStory getDetail(Integer gId) {
		// TODO Auto-generated method stub
		return tblStudentStoryMapper.selectByPrimaryKey(gId);
	}

	/**
	 * app获取
	 */
	@Override
	public ReturnData getListByApp() {
		// TODO Auto-generated method stub
		Map<String, Object> map = new HashMap<>();
		List<TblStudentStory> list = tblStudentStoryMapper.selectList(map);
		return new ReturnData(list,200,"学员故事列表");
	}

}
